package org.nobject.common.fan;

/**
 * FindByte
 *
 * @author bianrongjun
 * @version 1.0
 */
public class FindByte {
	
	/**
	 * getResults
	 * 
	 * EXP:
	 * getResults("123456789123456789123456789","01");
	 * 
	 * @param data
	 * @param strHexs
	 */
	public static void getResults(String data,String... strHexs){
		byte [] bs=data.getBytes();
		for (int i = 0; i < bs.length; i++) {
			if(Integer.toHexString(bs[i]).equals(strHexs[0])){
				if(strHexs.length>1){
					if(i<bs.length){
						if(Integer.toHexString(bs[i+1]).equals(strHexs[1])){
							System.out.println("Find In byte["+i+"]");
						}
					}
				}else{
					System.out.println("Find In byte["+i+"]");
				}
			}
			System.out.println(Integer.toHexString(bs[i]));
		}
		
		System.err.println("not find");
	}
}
